/*******************************************************************
 *   > File Name: buzzer.h
 *   > Author: fly
 *   > Mail: 1358326274@qq.com
 *   > Create Time: 2020年07月28日 星期二 22时09分35秒
 ******************************************************************/
#ifndef __BUZZER_H__
#define __BUZZER_H__

#define BUZZER_CTRL_BY_DUMMY    0
#define BUZZER_CTRL_BY_GPIO     1
#define BUZZER_CTRL_BY_PWM      2

#define BUZZER_CTRL_ENABLE      BUZZER_CTRL_BY_GPIO

#define GPD0CON     0xE02000A0
#define GPD0DAT     0xE02000A4
#define GPD0PUD     0xE02000A8

#define rGPD0CON    (*(unsigned int *)GPD0CON)
#define rGPD0DAT    (*(unsigned int *)GPD0DAT)
#define rGPD0PUD    (*(unsigned int *)GPD0PUD)

void buzzer_init(void);
void buzzer_set(unsigned int value);
void buzzer_test(void);
void delay(unsigned long count);

#endif /* __BUZZER_H__ */
